package com.smh;

/**
 * @author shiminghui
 * @date 2024/10/17 21:08
 * @description: TODO
 */
//这个就是枚举类
//枚举类就是一个无法被创建的类,
//他提供了一组常量,常量就是不可变的对象
//枚举类中的常量就是枚举对象
public class Season {
    private String season;
    private String desc;

    private Season(String season, String desc) { // 私有化构造方法
        this.season = season;
        this.desc = desc;
    }

    public static final Season SPRING = new Season("spring", "春天");
    public static final Season SUMMER = new Season("summer", "夏天");
    public static final Season AUTUMN = new Season("autumn", "秋天");
    public static final Season WINTER = new Season("winter", "冬天");

    public String getSeason() {
        return season;
    }

    public String getDescription() {
        return desc;
    }

    public String toString() {
        return season + ":" + desc;
    }
}
